﻿@using dPet.Application.DataObjects;
@using dPet.Web.Hospital.ViewModels;

@{
	var currentPrivilege = (PrivilegesDto)0;
	var currentStaff = LoginStaffModel.Current;

	if (currentStaff != null && currentStaff.StaffRole != null)
	{
		currentPrivilege = currentStaff.StaffRole.Privileges;
	}
}

<div class="accordion-group">
	<div id="ln_Home" class="accordion-heading">
		<a href="/"> <span class="glyphicon glyphicon-home"></span> 首页</a>
	</div>
</div>

<div class="accordion-group">
	<div class="accordion-heading">
		<a class="accordion-toggle" data-toggle="collapse" data-parent="#nav_accordion" href="#collapse2">
			<span class="glyphicon glyphicon-cog"></span> 配置管理
		</a>
	</div>
	<div id="collapse2" class="accordion-body collapse">
		@if ((PrivilegesDto.BillTemplateConfig & currentPrivilege) == PrivilegesDto.BillTemplateConfig)
		{
			<div id="ln_BillTemplateConfig" class="accordion-inner">
				<a href="@Url.Action("BillTemplateConfig", "Config")"><span class="glyphicon glyphicon-tags"></span> 票据模板配置</a>
			</div>
		}
	</div>
</div>

<div class="accordion-group">
	<div class="accordion-heading">
		<a class="accordion-toggle" data-toggle="collapse" data-parent="#nav_accordion" href="#collapse3">
			<span class="glyphicon glyphicon-inbox"></span> 库存管理
		</a>
	</div>
	<div id="collapse3" class="accordion-body collapse">
		@if ((PrivilegesDto.ProductCategoryManagement & currentPrivilege) == PrivilegesDto.ProductCategoryManagement)
		{
			<div id="ln_ProductCategoryList" class="accordion-inner">
				<a href="@Url.Action("CategoryList", "Product")"><span class="glyphicon glyphicon-th-list"></span> 类别管理</a>
			</div>
		}
		@if ((PrivilegesDto.ProductManagement & currentPrivilege) == PrivilegesDto.ProductManagement)
		{
			<div id="ln_ProductList" class="accordion-inner">
				<a href="@Url.Action("List", "Product")"><span class="glyphicon glyphicon-barcode"></span> 商品管理</a>
			</div>
		}
		@if ((PrivilegesDto.AddInventory & currentPrivilege) == PrivilegesDto.AddInventory)
		{
			<div id="ln_AddInventory" class="accordion-inner">
				<a href="@Url.Action("AddInventory", "Inventory")"><span class="glyphicon glyphicon-plus"></span> 商品入库</a>
			</div>
		}
		@if ((PrivilegesDto.InventoryBatchRecords & currentPrivilege) == PrivilegesDto.InventoryBatchRecords)
		{
			<div id="ln_InventoryBatchRecords" class="accordion-inner">
				<a href="@Url.Action("InventoryBatchRecords", "Inventory")"><span class="glyphicon glyphicon-list-alt"></span> 入库记录</a>
			</div>
		}
		@if ((PrivilegesDto.InventoryLORecords & currentPrivilege) == PrivilegesDto.InventoryLORecords)
		{
			<div id="ln_InventoryLORecords" class="accordion-inner">
				<a href="@Url.Action("InventoryLORecords", "Inventory")"><span class="glyphicon glyphicon-list-alt"></span> 报损报溢记录</a>
			</div>
		}
	</div>
</div>

@if ((PrivilegesDto.SaleOrderManagement & currentPrivilege) == PrivilegesDto.SaleOrderManagement)
{
	<div class="accordion-group">
		<div class="accordion-heading">
			<a class="accordion-toggle" data-toggle="collapse" data-parent="#nav_accordion" href="#collapse4">
				<span class="glyphicon glyphicon-euro"></span> 销售订单管理
			</a>
		</div>
		<div id="collapse4" class="accordion-body collapse">
			<div id="ln_CreateSaleOrder" class="accordion-inner">
				<a href="@Url.Action("Create", "SaleOrder")"><span class="glyphicon glyphicon-file"></span> 创建订单</a>
			</div>
			<div id="ln_SaleOrderList" class="accordion-inner">
				<a href="@Url.Action("List", "SaleOrder")"><span class="glyphicon glyphicon-list-alt"></span> 订单记录</a>
			</div>
		</div>
	</div>
}

<div class="accordion-group">
	<div class="accordion-heading">
		<a class="accordion-toggle" data-toggle="collapse" data-parent="#nav_accordion" href="#collapse5">
			<span class="glyphicon glyphicon-tags"></span> 服务配置管理
		</a>
	</div>
	<div id="collapse5" class="accordion-body collapse">
		@if ((PrivilegesDto.ServiceCategoryManagement & currentPrivilege) == PrivilegesDto.ServiceCategoryManagement)
		{
			<div id="ln_ServiceCategoryList" class="accordion-inner">
				<a href="@Url.Action("CategoryList", "Service")"><span class="glyphicon glyphicon-th-list"></span> 分类管理</a>
			</div>
		}
		@if ((PrivilegesDto.ServiceSKUPropertyManagement & currentPrivilege) == PrivilegesDto.ServiceSKUPropertyManagement)
		{
			<div id="ln_SKUPropertyList" class="accordion-inner">
				<a href="@Url.Action("SKUPropertyList", "Service")"><span class="glyphicon glyphicon-tag"></span> SKU属性管理</a>
			</div>
		}
		@if ((PrivilegesDto.ServiceItemManagement & currentPrivilege) == PrivilegesDto.ServiceItemManagement)
		{
			<div id="ln_ServiceItemList" class="accordion-inner">
				<a href="@Url.Action("ServiceItemList", "Service")"><span class="glyphicon glyphicon-bookmark"></span> 服务项管理</a>
			</div>
		}
	</div>
</div>

@if ((PrivilegesDto.ServiceOrderManagement & currentPrivilege) == PrivilegesDto.ServiceOrderManagement)
{
	<div class="accordion-group">
		<div class="accordion-heading">
			<a class="accordion-toggle" data-toggle="collapse" data-parent="#nav_accordion" href="#collapse6">
				<span class="glyphicon glyphicon-euro"></span> 服务订单管理
			</a>
		</div>
		<div id="collapse6" class="accordion-body collapse">
			<div id="ln_CreateServiceOrder" class="accordion-inner">
				<a href="@Url.Action("Create", "ServiceOrder")"><span class="glyphicon glyphicon-file"></span> 创建订单</a>
			</div>
			<div id="ln_ServiceOrderList" class="accordion-inner">
				<a href="@Url.Action("List", "ServiceOrder")"><span class="glyphicon glyphicon-list-alt"></span> 订单记录</a>
			</div>
		</div>
	</div>
}